#ifndef __TY_LAYER_H__
#define __TY_LAYER_H__

#include "TYBase.h"

typedef enum
{
	BACKGUOUND_LAYER = 2000,
	GAME_LAYER = 2050,
	MENU_LAYER = 2100,
	INFO_LAYER = 2150,
	MSGBOX_LAYER = 2200,
	NORMAL_LAYER = 2050,
}TYLAYERZORDER;

class TYLayer : public CCLayer
{
public:
	TYLayer(void);
	virtual ~TYLayer(void);

	virtual void registerWithTouchDispatcher(void);

	int getPriority(void);
	void setPriority(int nPriority);

	bool isSwallowsTouches(void);
	void setSwallowsTouches(bool bSwallowsTouches);

protected:
	int	m_nTYPriority;
	bool m_bTYSwallowsTouches;

};



class TYLayerBackGround : public TYLayer
{
public:
	TYLayerBackGround(void);
	virtual ~TYLayerBackGround(void);

	static TYLayerBackGround* layerWithFile(const char* images);

	virtual bool initWithFile(const char* images);

private:
	CCSprite* m_BackGroundSprite;

};


class TYLayerGame : public TYLayer
{
public:
	TYLayerGame(void);
	virtual ~TYLayerGame(void);

	virtual bool ccTouchBegan(CCTouch *pTouch, CCEvent *pEvent);

	// optional
	virtual void ccTouchMoved(CCTouch *pTouch, CCEvent *pEvent){}
	virtual void ccTouchEnded(CCTouch *pTouch, CCEvent *pEvent) {}
	virtual void ccTouchCancelled(CCTouch *pTouch, CCEvent *pEvent) {}

};

class TYLayerMenu : public TYLayer
{
public:
	TYLayerMenu(void);
	virtual ~TYLayerMenu(void);

	virtual void MenuItemCallBack( CCObject* sender );
};

class TYLayerInfo : public TYLayer
{
public:
	TYLayerInfo(void);
	virtual ~TYLayerInfo(void);
};

class TYLayerMessageBox : public TYLayer
{
public:	 
	TYLayerMessageBox(void);
	virtual ~TYLayerMessageBox(void);

	virtual void onEnter();
	
	virtual void onExit();

	virtual void MenuDoBack( CCObject* sender );

	virtual void MenuDoOtherTings( CCObject* sender );

	bool isBack( void );
	void setIsBack( bool bBack);

private:
	bool m_bIsBack;
};

#endif //__TY_LAYER_H__